package com.bdqn.S64.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin")
public class AdminController {

    @GetMapping("/test")
    @PreAuthorize("hasAuthority('admin:add')")
    public String admin(){
        return "I am admin";
    }

    @GetMapping("add")
    public String add(){
        return "添加管理员成功";
    }

    @GetMapping("del")
    public String del(){
        return "删除管理员成功";
    }

    @GetMapping("update")
    public String update(){
        return "修改管理员成功";
    }
}
